package com.design02_Structural.pattern06_proxy.proxy01;

/**
 * @ClassName UserDaoProxy
 * @Description TODO
 * @Author zhangjunhao
 * @DATE 2023/9/3 19:48
 */
public class UserDaoProxy implements IUserDao  {

    private IUserDao target;


    public UserDaoProxy(IUserDao target) {
        this.target = target;
    }


    @Override
    public void save() {
        System.out.println("开启事务");
        //扩展额外功能
        target.save();
        System.out.println("提交事务");
    }


}
